<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');
/**
 * Model m_user_group
 *
 * @author luubk
 * @since 10-06-2012 - 14:43:47
 */
class M_user_has_group extends MY_Model
{

    function __construct()
    {
        $this->table = 'user_has_group';

        parent::__construct();
    }

    function multi_select_user_roles($where = array(), $order = FALSE, $limit = FALSE, $offset = 0){
    	$this->db->select();
    	$this->db->from($this->table);

    	$this->db->join('user_group', 'user_has_group.user_group_id = user_group.ug_id', 'LEFT');

    	foreach ($where as $key => $val)
    		$this->db->where($key, $val);

    	if ($order)
    		$this->db->order_by($order);

    	if ($limit)
    		$this->db->limit($limit, $offset);

    	$query = $this->db->get();

    	if ($query->num_rows() > 0)
    		return $query->result_array();
    	else
    		return FALSE;
    }

}


/**
 * End file m_user_group
 */
